/*
 * Arrays.java   Jul 14, 2004
 *
 * Copyright (c) 2004 Stan Salvador
 * stansalvador@hotmail.com
 */

package cn.ac.ict.fpevaluation.fastdtw.util;

import cn.ac.ict.fpevaluation.bean.APBean;

import java.util.List;

/**
 * ŷ������
 *
 * @author Administrator
 */
public class EuclideanDistance implements DistanceFunction {
    public double calcDistance(double[] vector1, double[] vector2) {
        if (vector1.length != vector2.length)
            throw new InternalError("ERROR:  cannot calculate the distance "
                    + "between vectors of different sizes.");

        double sqSum = 0.0;
        for (int x = 0; x < vector1.length; x++)
            sqSum += Math.pow(vector1[x] - vector2[x], 2.0);
        double result = Math.sqrt(sqSum);

        return result;
    }

    public double calcDistance(List<APBean> list1, List<APBean> list2) {
        return -1;
    }

}